<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>学院管理</title>
    <link rel="stylesheet" href="css/button.css">
    <script src="js/myJs.js"></script>
    <style type="text/css" rel="stylesheet">
        .faculty {
            width: 230px;
        }

        .faculty {
            width: 200px;
        }

        .operate {
            width: 160px;
        }

        /* gridtable */
        table.grid {
            font-family: verdana, arial, sans-serif;
            font-size: 13px;
            color: #333333;
            border-width: 1px;
            border-color: #666666;
            border-collapse: collapse;
            text-align: center;
        }

        table.grid th {
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #666666;
            background-color: #dedede;
        }

        table.grid td {
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #666666;
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<table align="center" class="grid">
    <tr>
        <th colspan="3">班级管理</th>
    </tr>
    <tr>
        <form action="FacultyServlet?action=showClass&facultyId=${Faculty.facultyId}" id="selectFaculty" method="post">
            <th colspan="3">
                <select id="fa" name="fa">
                    <c:forEach items="${faculties}" var="Faculty">
                        <option value="${Faculty.facultyId}" >${Faculty.facultyName}</option>
                    </c:forEach>
                </select>
                <input type="button" value="查找" onclick="${"selectFaculty"}.submit()">
            </th>
        </form>
    </tr>
    <tr>
        <th class="faculty">学院</th>
        <th class="classes">班级</th>
        <th class="operate">操作</th>
    </tr>
    <c:forEach items="${classes}" var="cl">
        <tr>
            <td class="faculty">${cl.faculty.facultyName}</td>
            <td class="classes">${cl.className}</td>
            <td class="operate">
                <input class="delete-but" value="删除" type="button"
                       onclick="window.open('FacultyServlet?action=','_self')">
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="3">
            <div align="center">
                <%@ include file="page.jsp"%>
            </div>
        </td>
    </tr>
    <tr>
        <th colspan="3">
            <input class="add-but" value="添加班级" type="button"
                   onclick="openWin('FacultyServlet?action=','',500,200,0);"/>
        </th>
    </tr>
</table>
</body>
</html>